<html><!doctype html>
<html>
<head>
    <meta charset="utf-8"/>
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-touch-fullscreen" content="yes">
    <script src="../../../../../../../g.tbcdn.cn/kissy/k/1.3.2/seed.js" tppabs="http://g.tbcdn.cn/kissy/k/1.3.2/seed.js" data-config="{combine:true}"></script>
</head>
<body>
<h1>open in ios safari test pinch event</h1>

<div id='t' tabindex='0'
     style='border:1px solid green;
     width:200px;height:200px;margin:100px'>
    pinch me
</div>
<script>

    KISSY.use('event', function (S, Event) {

        Event.on('#t', "pinch pinchStart pinchEnd", function (e) {
            S.log(e.type + ' : ' + e.scale);
        });

        var o;

        var t = document.getElementById('t');

        Event.on('#t', 'pinchStart', function () {
            o = 1;
            if (t.style.webkitTransform) {
                o = parseFloat(t.style.webkitTransform.replace(/scale\(/, ''));
            }
        });

        Event.on('#t', 'pinch', function (e) {
            t.style.webkitTransform = 'scale(' + (o * e.scale) + ')';
        });

    });

</script>
</body>
</html>